/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.active;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BIN;

/**
 * <b>(DianlanSettingCard)</b>
 * <p>
 * 设置卡号
 * 帧类型码 0x44
 * 序列号域 0007
 * 数据长度
 * 帧校验域 F264
 *
 * @author czj
 * @version 1.0.0
 * @since 2023/2/9
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanSettingCard {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String stubNo;
    /** 下发卡数量 */
    @Builder.Default
    @DianlanProtocol(length = 1, start = 7, end = 8, dataType = BCD)
    String cardCount       = "15";
    /** 物理卡号 */
    @Builder.Default
    @DianlanProtocol(length = 8, start = 8, end = 16, dataType = BIN)
    String physicsCardNo1  = "0000000000000001";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 16, end = 24, dataType = BIN)
    String physicsCardNo2  = "0000000000000002";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 24, end = 32, dataType = BIN)
    String physicsCardNo3  = "0000000000000003";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 32, end = 40, dataType = BIN)
    String physicsCardNo4  = "0000000000000004";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 40, end = 48, dataType = BIN)
    String physicsCardNo5  = "0000000000000005";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 48, end = 56, dataType = BIN)
    String physicsCardNo6  = "0000000000000006";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 56, end = 64, dataType = BIN)
    String physicsCardNo7  = "0000000000000007";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 64, end = 72, dataType = BIN)
    String physicsCardNo8  = "0000000000000008";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 72, end = 80, dataType = BIN)
    String physicsCardNo9  = "0000000000000009";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 80, end = 88, dataType = BIN)
    String physicsCardNo10 = "0000000000000010";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 88, end = 96, dataType = BIN)
    String physicsCardNo11 = "0000000000000011";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 96, end = 104, dataType = BIN)
    String physicsCardNo12 = "0000000000000012";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 104, end = 112, dataType = BIN)
    String physicsCardNo13 = "0000000000000013";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 112, end = 120, dataType = BIN)
    String physicsCardNo14 = "0000000000000014";
    @Builder.Default
    @DianlanProtocol(length = 8, start = 120, end = 128, dataType = BIN)
    String physicsCardNo15 = "0000000000000015";
}